<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: slider.php 135 2013-09-22 07:30:55Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 135 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:30:55 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

$slider = $db->db_query("SELECT 
								slider_id 
							FROM 
								".TABLE_SLIDER." 
							WHERE 
								categories_id = '".$current_category_id."' ");

if($slider->_numOfRows && !$browser->isMobile(USE_MOBILE_TEMPLATE)) {
	$s_images = $db->db_query("SELECT 
									image_name,
									description,
									link
								FROM
									".TABLE_SLIDER_IMAGES." 
								WHERE
									language_id = '".$_SESSION['languages_id']."'
								AND
									slider_id = '".$slider->fields['slider_id']."'");
	
	if($s_images->_numOfRows) {		
		$slider_smarty = new Smarty();
		$slider_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
		
		$content = '';
		while(!$s_images->EOF) {
			$content .= '<li>
							<img rel="'.$s_images->fields['link'].'" '.(!empty($s_images->fields['description']) ? 'longdesc="'.$s_images->fields['description'].'" ':'').'src="images/slider/slider_big/'.$s_images->fields['image_name'].'" alt="" />
						</li>';
			$s_images->MoveNext();
		}
		
		$get[] = 'sl=true';
		
		$slider_smarty->assign('content', $content);
		$slider_smarty->caching = 0;
		$module = $slider_smarty->fetch(CURRENT_TEMPLATE.'/module/slider.html');
		if(isset($listing->result) && $listing->result > 0)
			$module_smarty->assign('slider', $module);
		else
			$default_smarty->assign('slider', $module);
	}		
}